<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>

		<script type="text/javascript">
			var arr = new Array(30);
			var arr1 = [];
			var num = 0;
			var index = 0;
			//循环创建数组
			for (var i = 0; i < arr.length; i++) {
				
				arr[i] = (i + 1) * 2;


			}
			for (var j = 0; j < arr.length; j++) {
				num += arr[j];

				if (j % 5 === 4) {
					//满足条件加够5个数  求平均值
					arr1[index] = num / 5;
					num = 0;//重置平均数
					index++;
				}


			}
		</script>
	</body>
</html>
